next up previous contents index
Next: Base types Up: The Pascal language Previous: Typed constants

Types

All variables have a type. Free Pascal supports the same basic types as Turbo Pascal, with some extra types from Delphi.

You can declare your own types, which is in essence defining an identifier that can be used to denote your custom type when declaring variables further in the source code.


Type declaration

syntdiag921

There are 7 major type classes :


Types

syntdiag959

The last class, type identifier, is just a means to give another name to a type. This gives you a way to make types platform independent, by only using your own types, and then defining these types for each platform individually. The programmer that uses your units doesn't have to worry about type size and so on. It also allows you to use shortcut names for fully qualified type names. You can e.g. define system.longint as Olongint and then redefine longint.




next up previous contents index
Next: Base types Up: The Pascal language Previous: Typed constants

Michael Van Canneyt
Fri Sep 25 09:15:40 MEST 1998